package com.ruifu.common.feign.factory;

import com.ruifu.common.feign.RemoteProjService;
import com.ruifu.common.feign.fallback.RemoteProjServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteProjServiceFallbackFactory implements FallbackFactory<RemoteProjService> {

@Override
public RemoteProjService create(Throwable throwable) {
    RemoteProjServiceFallbackImpl remoteProjServiceFallback = new RemoteProjServiceFallbackImpl();
    remoteProjServiceFallback.setCause(throwable);
        return remoteProjServiceFallback;
        }
}
